/*
 * @Author: xiaosihan 
 * @Date: 2024-08-17 22:31:29 
 * @Last Modified by: xiaosihan
 * @Last Modified time: 2024-08-18 01:40:12
 */
import { BufferAttribute, BufferGeometry, Line, LineBasicMaterial, Vector2, Vector3 } from "three";
import { degToRad } from "three/src/math/MathUtils";
export default class CtxMesh extends Line {
    constructor() {
        super();
    }

    frustumCulled = false;

    // 线条模型
    geometry = (() => {
        const geometry = new BufferGeometry();
        const p: Array<number> = [];
        const initP = new Vector2(1, 0);
        const conter = new Vector2(0, 0);
        for (let i = 0; i < 361; i++) {
            initP.set(1, 0).rotateAround(conter, degToRad(i));
            p.push(initP.x, initP.y, 0);
        }

        let positionArray = new Float32Array(p);
        let position = new BufferAttribute(positionArray, 3, false);
        geometry.setAttribute("position", position);
        return geometry;
    })();

    material = new LineBasicMaterial({
        color: "#fff",
        depthTest: false,
        depthWrite: false,
    });

}
